namespace go userserver

struct User{
    1:i64 ID
    2:string Name
    3:i64 FollowCount
    4:i64 FollowerCount
    5:bool IsFollow
}

struct GetUserByIdRequest{
    1:i64 userId
}

struct GetUserByIdResponse{
    1:User user
}

struct GetUserByNameRequest{
    1:string username
}

struct GetUserByNameResponse{
    1:User user
}
struct CreateUserRequest{
    1:string username
    2:string password
}

struct CreateUserResponse{
    1:i64 userId
}

struct LoginUserRequest{
    1:string username
    2:string password
}

struct LoginUserResponse{
    1:i64 userId
    2:string token
}

service UserService {
    GetUserByIdResponse GetUserById (1:GetUserByIdRequest req)
    CreateUserResponse CreateUser (1:CreateUserRequest req)
    GetUserByNameResponse GetUserByName(1:GetUserByNameRequest req)
    LoginUserResponse LoginUser(1:LoginUserRequest req)
}